The SQL Console is Trilium's built-in database editor.

It can be accessed by going to the Global menu → Advanced → Open SQL Console.

Interaction

Interacting with the table

After executing a query, a table with the results will be displayed:

Saved SQL console

SQL queries or commands can be saved into a dedicated note.

To do so, simply write the query and press the button. Once saved, the note will appear in Day Notes.

The note can be locked for editing by pressing the Lock button in the note actions section near the title bar (on the New Layout, or in the Floating buttons area if using the old layout). When editing is locked, the SQL statement is hidden from view.